<?php
class CV_Datastore_Metadata_Relational_Manager{
	function create_provider( $source ){
		if( $source instanceof PDO ){
			$driver = $source->getAttribute( PDO::ATTR_DRIVER_NAME );
			switch( $driver ){
				case 'mysql':
					return new CV_Datastore_Metadata_Relational_Provider_Mysql( $source );
			}
			throw new CV_Exeption( 'Cannot create relational metadata provider for pdo driver '.$driver );
		}
		throw new CV_Exeption( 'Cannot create relational metadata provider for source of type '.get_class($source) );
	}
}